//
//  EmploymentDetFourCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2017/12/27.
//  Copyright © 2017年 beisheng. All rights reserved.
//

#import "EmploymentDetFourCell.h"
@interface EmploymentDetFourCell ()
@property (weak, nonatomic) IBOutlet UILabel *topLabel;
@property (weak, nonatomic) IBOutlet UILabel *middleLabel;
@property (weak, nonatomic) IBOutlet UILabel *bottomLabel;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomMargin;
@property (weak, nonatomic) IBOutlet UIView *lineView;

@end
@implementation EmploymentDetFourCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.contentView.backgroundColor = [UIColor whiteColor];
    
    self.bottomMargin.constant = 10;
    
    self.lineView.backgroundColor = lineGray;
    
    self.topLabel.font = MYFONT(16);
    
    self.middleLabel.font = MYFONT(15);
    
//    self.bottomLabel.font = MYFONT(14);
    
    self.middleLabel.textColor = darkGray;
    
    
    self.bottomLabel.text = nil;

    
    
}

- (void)setModel:(EmploymentListModel *)model{
    
    _model = model;
    
    self.bottomLabel.attributedText = [self attributedString:_model.company_desc withFont:MYFONT(14)];

    
}


- (NSAttributedString *)attributedString:(NSString *)str withFont:(UIFont *)font{
    
    NSMutableAttributedString *attr = [[NSMutableAttributedString alloc]initWithString:str];
    
    [attr addAttribute:NSFontAttributeName value:font range:NSMakeRange(0, str.length)];
    [attr addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange(0, str.length)];
    [attr addAttribute:NSKernAttributeName value:@(1.0f) range:NSMakeRange(0, str.length)];
    
    NSMutableParagraphStyle *para = [[NSMutableParagraphStyle alloc]init];
    
    para.lineSpacing = 1;
    
//    para.firstLineHeadIndent = 20;
    
    [attr addAttribute:NSParagraphStyleAttributeName value:para range:NSMakeRange(0, str.length)];
    
    
    return attr;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
